;--------------------------------------------------------------------------------------------------------
; x64dbg plugin SDK for Masm - fearless 2016 - www.LetTheLight.in
;
; Supports 32bit x32dbg only.
;
; Include file for capstone_x86.dll exports, constants and structures.
;
; This is a conversion of the original plugin sdk files: capstone.h, x86.h & platform.h to a format that 
; will work with MASM and other assemblers (possibly).
;
; Where are name of a structure, structure field or other definitions conflict with a masm reserved word
; I have appended a underscore at the end of the item in most cases to work around that issue.
; There are a few exceptions: addr becomes address, end becomes finish, just for clarity.
;
; The enum macro provided emulates the enum behaviour in the origal pluginsdk files, however if masm 
; complains about line too complex during compilation, i have had to change some of the enums to
; to lines of ITEMNAME EQU VALUE type statements instead, which approximate the same function anyhow.
;
;--------------------------------------------------------------------------------------------------------


; Capstone API version
CS_API_MAJOR        EQU 4
CS_API_MINOR        EQU 0
CS_NEXT_VERSION     EQU 3
CS_MAKE_VERSION     EQU 768d ; 300h - ((major << 8) + minor)
CS_MNEMONIC_SIZE    EQU 32

size_t              TYPEDEF DWORD
csh                 TYPEDEF size_t

; enum macro is used to enumerate constants - similar to how enum works in c. 
enum macro _param_:VARARG
    _segname_ textequ @CurSeg
    _val_=0
    % forc _chr_,_segname_
        _val_=_val_+'&_chr_'
    endm
    IFNB <_param_>
        _count_=0
        _temp_ textequ <0>
        _ldata_ textequ <_DATA>
        for _arg_,<_param_>
            _pos_ instr <_arg_>,<=>
            if _pos_ ne 0
                _temp_ SubStr <_arg_>,_pos_+1
                if _val_ ne 179H ;;179H ='_' + 'D' + 'A' + 'T' + 'A'
                    @SubStr(<_arg_>,1,_pos_-1) equ _temp_
                else
                    @SubStr(<_arg_>,1,_pos_-1) dd _temp_
                endif
                _count_=1
            else
                if _val_ ne 179H ;;179H ='_' + 'D' + 'A' + 'T' + 'A'
                    _arg_ equ _temp_+_count_
                else
                    _arg_ dd _temp_+_count_
                endif
                _count_=_count_+1
            endif
        endm
    ENDIF
endm 

; Architecture type
CS_ARCH_ARM             EQU 0       ; ARM architecture (including Thumb, Thumb-2)
CS_ARCH_ARM64           EQU 1       ; ARM-64, also called AArch64
CS_ARCH_MIPS            EQU 2       ; Mips architecture
CS_ARCH_X86             EQU 3       ; X86 architecture (including x86 & x86-64)
CS_ARCH_PPC             EQU 4       ; PowerPC architecture
CS_ARCH_SPARC           EQU 5       ; Sparc architecture
CS_ARCH_SYSZ            EQU 6       ; SystemZ architecture
CS_ARCH_XCORE           EQU 7       ; XCore architecture
CS_ARCH_MAX             EQU 8       ; 
CS_ARCH_ALL             EQU 0FFFFh  ; All architectures - for cs_support()


CS_SUPPORT_DIET         EQU (CS_ARCH_ALL + 1)
CS_SUPPORT_X86_REDUCE   EQU (CS_ARCH_ALL + 2)

; Mode type
CS_MODE_LITTLE_ENDIAN   EQU 0       ; little-endian mode (default mode)
CS_MODE_ARM             EQU 0       ; 32-bit ARM
CS_MODE_16              EQU 2       ; = 1 << 1 - 16-bit mode (X86)
CS_MODE_32              EQU 4       ; = 1 << 2 - 32-bit mode (X86)
CS_MODE_64              EQU 8       ; = 1 << 3 - 64-bit mode (X86, PPC)
CS_MODE_THUMB           EQU 16d     ; = 1 << 4 - ARM's Thumb mode, including Thumb-2
CS_MODE_MCLASS          EQU 32d     ; = 1 << 5 - ARM's Cortex-M series
CS_MODE_V8              EQU 64d     ; = 1 << 6 - ARMv8 A32 encodings for ARM
CS_MODE_MICRO           EQU 16d     ; = 1 << 4 - MicroMips mode (MIPS)
CS_MODE_MIPS3           EQU 32d     ; = 1 << 5 - Mips III ISA
CS_MODE_MIPS32R6        EQU 64d     ; = 1 << 6 - Mips32r6 ISA
CS_MODE_MIPSGP64        EQU 128d    ; = 1 << 7 - General Purpose Registers are 64-bit wide (MIPS)
CS_MODE_V9              EQU 16d     ; = 1 << 4 - SparcV9 mode (Sparc)
CS_MODE_BIG_ENDIAN      EQU 2147483648d ; = 1 << 31 - big-endian mode
CS_MODE_MIPS32          EQU CS_MODE_32; Mips32 ISA (Mips)
CS_MODE_MIPS64          EQU CS_MODE_64; Mips64 ISA (Mips)


cs_malloc_t             PROTO C :DWORD ; (size_t size);
cs_calloc_t             PROTO C :DWORD, :DWORD ; (size_t nmemb, size_t size);
cs_realloc_t            PROTO C :DWORD, :DWORD ; (void* ptr, size_t size);
cs_free_t               PROTO C :DWORD ; (void* ptr);
;cs_vsnprintf_t          PROTO C :DWORD, :DWORd, :DWORD, :DWORD, :DWORD ; (char* str, size_t size, const char* format, va_list ap);

; User-defined dynamic memory related functions: malloc/calloc/realloc/free/vsnprintf()
; By default, Capstone uses system's malloc(), calloc(), realloc(), free() & vsnprintf().
cs_opt_mem              STRUCT
    malloc              DD ? ; cs_malloc_t 
    calloc              DD ? ; cs_calloc_t 
    realloc             DD ? ; cs_realloc_t 
    free                DD ? ; cs_free_t 
    vsnprintf           DD ? ; cs_vsnprintf_t 
cs_opt_mem              ENDS

; Customize mnemonic for instructions with alternative name.
cs_opt_mnem             STRUCT
    id                  DWORD ? ; unsigned int ID of instruction to be customized.
    mnemonic            DWORD ? ; char* Customized instruction mnemonic.
cs_opt_mnem             ENDS



; Runtime option for the disassembled engine
CS_OPT_SYNTAX           EQU 1 ; Assembly output syntax
CS_OPT_DETAIL           EQU 2 ; Break down instruction structure into details
CS_OPT_MODE             EQU 3 ; Change engine's mode at run-time
CS_OPT_MEM              EQU 4 ; User-defined dynamic memory related functions
CS_OPT_SKIPDATA         EQU 5 ; Skip data when disassembling. Then engine is in SKIPDATA mode.
CS_OPT_SKIPDATA_SETUP   EQU 6 ; Setup user-defined function for SKIPDATA option
CS_OPT_MNEMONIC         EQU 7 ; Customize instruction mnemonic

; Runtime option value (associated with option type above)
CS_OPT_OFF              EQU 0 ; Turn OFF an option - default option of CS_OPT_DETAIL, CS_OPT_SKIPDATA.
CS_OPT_ON               EQU 3 ; Turn ON an option (CS_OPT_DETAIL, CS_OPT_SKIPDATA).
CS_OPT_SYNTAX_DEFAULT   EQU 0 ; Default asm syntax (CS_OPT_SYNTAX).
CS_OPT_SYNTAX_INTEL     EQU 1 ; Intel asm syntax - default on X86 (CS_OPT_SYNTAX).
CS_OPT_SYNTAX_ATT       EQU 2 ; X86 ATT asm syntax (CS_OPT_SYNTAX).
CS_OPT_SYNTAX_NOREGNAME EQU 3 ; Prints register name with only number (CS_OPT_SYNTAX)
CS_OPT_SYNTAX_MASM      EQU 4 ; X86 Intel Masm syntax (CS_OPT_SYNTAX).

; Common instruction operand types - to be consistent across all architectures.
CS_OP_INVALID           EQU 0 ; uninitialized/invalid operand.
CS_OP_REG               EQU 1 ; Register operand.
CS_OP_IMM               EQU 2 ; Immediate operand.
CS_OP_MEM               EQU 3 ; Memory operand.
CS_OP_FP                EQU 4 ; Floating-Point operand.

; Common instruction operand access types - to be consistent across all architectures.
; It is possible to combine access types, for example: CS_AC_READ | CS_AC_WRITE
CS_AC_INVALID           EQU 0 ; Uninitialized/invalid access type.
CS_AC_READ              EQU 1 ; = 1 << 0 Operand read from memory or register.
CS_AC_WRITE             EQU 2 ; = 1 << 1 Operand write to memory or register.


; Common instruction groups - to be consistent across all architectures.
CS_GRP_INVALID          EQU 0 ; uninitialized/invalid group.
CS_GRP_JUMP             EQU 1 ; all jump instructions (conditional+direct+indirect jumps)
CS_GRP_CALL             EQU 2 ; all call instructions
CS_GRP_RET              EQU 3 ; all return instructions
CS_GRP_INT              EQU 4 ; all interrupt instructions (int+syscall)
CS_GRP_IRET             EQU 5 ; all interrupt return instructions
CS_GRP_PRIVILEGE        EQu 6 ; all privileged instructions


; User-defined callback function for SKIPDATA option.
; See tests/test_skipdata.c for sample code demonstrating this API.
;
; @code: the input buffer containing code to be disassembled.
; This is the same buffer passed to cs_disasm().
; @code_size: size (in bytes) of the above @code buffer.
; @offset: the position of the currently-examining byte in the input
; buffer @code mentioned above.
; @user_data: user-data passed to cs_option() via @user_data field in
; cs_opt_skipdata struct below.
;
; @return: return number of bytes to skip, or 0 to immediately stop disassembling.

cs_skipdata_cb_t        PROTO C :DWORD, :DWORD, :DWORD, :DWORD ;(const uint8_t* code, size_t code_size, size_t offset, void* user_data);

; cs_opt_skipdata - User-customized setup for SKIPDATA option
;
; Capstone considers data to skip as special "instructions". User can specify the string for this instruction's "mnemonic" here. By default (if @mnemonic is NULL), Capstone use ".byte".
; User-defined callback function to be called when Capstone hits data.
; If the returned value from this callback is positive (>0), Capstone
; will skip exactly that number of bytes & continue. Otherwise, if
; the callback returns 0, Capstone stops disassembling and returns
; immediately from cs_disasm()
; NOTE: if this callback pointer is NULL, Capstone would skip a number
; of bytes depending on architectures, as following:
; Arm:     2 bytes (Thumb mode) or 4 bytes.
; Arm64:   4 bytes.
; Mips:    4 bytes.
; PowerPC: 4 bytes.
; Sparc:   4 bytes.
; SystemZ: 2 bytes.
; X86:     1 bytes.
; XCore:   2 bytes.
;
cs_opt_skipdata         STRUCT
    mnemonic            DD ? ; const char* 
    callback            DD ? ; pointer to cs_skipdata_cb_t type function. default value is NULL
    user_data           DD ? ; User-defined data to be passed to @callback function pointer.
cs_opt_skipdata         ENDS

; x86.h 
;
; Typedefs
x86_reg                 TYPEDEF DWORD
x86_op_type             TYPEDEF DWORD
x86_avx_bcast           TYPEDEF DWORD
x86_xop_cc              TYPEDEF DWORD
x86_sse_cc              TYPEDEF DWORD
x86_avx_cc              TYPEDEF DWORD
x86_avx_rm              TYPEDEF DWORD
x86_prefix              TYPEDEF DWORD
x86_op_mem              TYPEDEF DWORD
x86_insn                TYPEDEF DWORD
x86_insn_group          TYPEDEF DWORD


; X86 registers
X86_REG_INVALID         EQU 0
enum X86_REG_AH=1d, X86_REG_AL, X86_REG_AX, X86_REG_BH, X86_REG_BL
enum X86_REG_BP=6d, X86_REG_BPL, X86_REG_BX, X86_REG_CH, X86_REG_CL
enum X86_REG_CS=11d, X86_REG_CX, X86_REG_DH, X86_REG_DI, X86_REG_DIL
enum X86_REG_DL=16d, X86_REG_DS, X86_REG_DX, X86_REG_EAX, X86_REG_EBP
enum X86_REG_EBX=21d, X86_REG_ECX, X86_REG_EDI, X86_REG_EDX, X86_REG_EFLAGS
enum X86_REG_EIP=26d, X86_REG_EIZ, X86_REG_ES, X86_REG_ESI, X86_REG_ESP
enum X86_REG_FPSW=31d, X86_REG_FS, X86_REG_GS, X86_REG_IP, X86_REG_RAX
enum X86_REG_RBP=36d, X86_REG_RBX, X86_REG_RCX, X86_REG_RDI, X86_REG_RDX
enum X86_REG_RIP=41d, X86_REG_RIZ, X86_REG_RSI, X86_REG_RSP, X86_REG_SI
enum X86_REG_SIL=46d, X86_REG_SP, X86_REG_SPL, X86_REG_SS, X86_REG_CR0
enum X86_REG_CR1=51d, X86_REG_CR2, X86_REG_CR3, X86_REG_CR4, X86_REG_CR5
enum X86_REG_CR6=56d, X86_REG_CR7, X86_REG_CR8, X86_REG_CR9, X86_REG_CR10
enum X86_REG_CR11=61d, X86_REG_CR12, X86_REG_CR13, X86_REG_CR14, X86_REG_CR15
enum X86_REG_DR0=66d, X86_REG_DR1, X86_REG_DR2, X86_REG_DR3, X86_REG_DR4
enum X86_REG_DR5=71d, X86_REG_DR6, X86_REG_DR7, X86_REG_DR8, X86_REG_DR9
enum X86_REG_DR10=76d, X86_REG_DR11, X86_REG_DR12, X86_REG_DR13, X86_REG_DR14
enum X86_REG_DR15=81d, X86_REG_FP0, X86_REG_FP1, X86_REG_FP2, X86_REG_FP3
enum X86_REG_FP4=86d, X86_REG_FP5, X86_REG_FP6, X86_REG_FP7
enum X86_REG_K0=90d, X86_REG_K1, X86_REG_K2, X86_REG_K3, X86_REG_K4
enum X86_REG_K5=95d, X86_REG_K6, X86_REG_K7, X86_REG_MM0, X86_REG_MM1
enum X86_REG_MM2=100d, X86_REG_MM3, X86_REG_MM4, X86_REG_MM5, X86_REG_MM6
enum X86_REG_MM7=105d, X86_REG_R8, X86_REG_R9, X86_REG_R10, X86_REG_R11
enum X86_REG_R12=110d, X86_REG_R13, X86_REG_R14, X86_REG_R15
enum X86_REG_ST0=114d, X86_REG_ST1, X86_REG_ST2, X86_REG_ST3
enum X86_REG_ST4=118d, X86_REG_ST5, X86_REG_ST6, X86_REG_ST7
enum X86_REG_XMM0=122d, X86_REG_XMM1, X86_REG_XMM2, X86_REG_XMM3, X86_REG_XMM4
enum X86_REG_XMM5=127d, X86_REG_XMM6, X86_REG_XMM7, X86_REG_XMM8, X86_REG_XMM9
enum X86_REG_XMM10=132d, X86_REG_XMM11, X86_REG_XMM12, X86_REG_XMM13, X86_REG_XMM14
enum X86_REG_XMM15=137d, X86_REG_XMM16, X86_REG_XMM17, X86_REG_XMM18, X86_REG_XMM19
enum X86_REG_XMM20=142d, X86_REG_XMM21, X86_REG_XMM22, X86_REG_XMM23, X86_REG_XMM24
enum X86_REG_XMM25=147d, X86_REG_XMM26, X86_REG_XMM27, X86_REG_XMM28, X86_REG_XMM29
enum X86_REG_XMM30=152d, X86_REG_XMM31, X86_REG_YMM0, X86_REG_YMM1, X86_REG_YMM2
enum X86_REG_YMM3=157d, X86_REG_YMM4, X86_REG_YMM5, X86_REG_YMM6, X86_REG_YMM7
enum X86_REG_YMM8=162d, X86_REG_YMM9, X86_REG_YMM10, X86_REG_YMM11, X86_REG_YMM12
enum X86_REG_YMM13=167d, X86_REG_YMM14, X86_REG_YMM15, X86_REG_YMM16, X86_REG_YMM17
enum X86_REG_YMM18=173d, X86_REG_YMM19, X86_REG_YMM20, X86_REG_YMM21, X86_REG_YMM22
enum X86_REG_YMM23=177d, X86_REG_YMM24, X86_REG_YMM25, X86_REG_YMM26, X86_REG_YMM27
enum X86_REG_YMM28=182d, X86_REG_YMM29, X86_REG_YMM30, X86_REG_YMM31, X86_REG_ZMM0
enum X86_REG_ZMM1=187d, X86_REG_ZMM2, X86_REG_ZMM3, X86_REG_ZMM4, X86_REG_ZMM5
enum X86_REG_ZMM6=192d, X86_REG_ZMM7, X86_REG_ZMM8, X86_REG_ZMM9, X86_REG_ZMM10
enum X86_REG_ZMM11=197d, X86_REG_ZMM12, X86_REG_ZMM13, X86_REG_ZMM14, X86_REG_ZMM15
enum X86_REG_ZMM16=202d, X86_REG_ZMM17, X86_REG_ZMM18, X86_REG_ZMM19, X86_REG_ZMM20
enum X86_REG_ZMM21=207d, X86_REG_ZMM22, X86_REG_ZMM23, X86_REG_ZMM24, X86_REG_ZMM25
enum X86_REG_ZMM26=212d, X86_REG_ZMM27, X86_REG_ZMM28, X86_REG_ZMM29, X86_REG_ZMM30
enum X86_REG_ZMM31=217d, X86_REG_R8B, X86_REG_R9B, X86_REG_R10B, X86_REG_R11B
enum X86_REG_R12B=222d, X86_REG_R13B, X86_REG_R14B, X86_REG_R15B, X86_REG_R8D
enum X86_REG_R9D=227d, X86_REG_R10D, X86_REG_R11D, X86_REG_R12D, X86_REG_R13D
enum X86_REG_R14D=232d, X86_REG_R15D, X86_REG_R8W, X86_REG_R9W, X86_REG_R10W
enum X86_REG_R11W=237d, X86_REG_R12W, X86_REG_R13W, X86_REG_R14W, X86_REG_R15W
X86_REG_ENDING          EQU 242d ; <-- mark the end of the list of registers

; Sub-flags of EFLAGS
; #define X86_EFLAGS_MODIFY_AF (1ULL << 0)
; #define X86_EFLAGS_MODIFY_CF (1ULL << 1)
; #define X86_EFLAGS_MODIFY_SF (1ULL << 2)
; #define X86_EFLAGS_MODIFY_ZF (1ULL << 3)
; #define X86_EFLAGS_MODIFY_PF (1ULL << 4)
; #define X86_EFLAGS_MODIFY_OF (1ULL << 5)
; #define X86_EFLAGS_MODIFY_TF (1ULL << 6)
; #define X86_EFLAGS_MODIFY_IF (1ULL << 7)
; #define X86_EFLAGS_MODIFY_DF (1ULL << 8)
; #define X86_EFLAGS_MODIFY_NT (1ULL << 9)
; #define X86_EFLAGS_MODIFY_RF (1ULL << 10)
; #define X86_EFLAGS_PRIOR_OF (1ULL << 11)
; #define X86_EFLAGS_PRIOR_SF (1ULL << 12)
; #define X86_EFLAGS_PRIOR_ZF (1ULL << 13)
; #define X86_EFLAGS_PRIOR_AF (1ULL << 14)
; #define X86_EFLAGS_PRIOR_PF (1ULL << 15)
; #define X86_EFLAGS_PRIOR_CF (1ULL << 16)
; #define X86_EFLAGS_PRIOR_TF (1ULL << 17)
; #define X86_EFLAGS_PRIOR_IF (1ULL << 18)
; #define X86_EFLAGS_PRIOR_DF (1ULL << 19)
; #define X86_EFLAGS_PRIOR_NT (1ULL << 20)
; #define X86_EFLAGS_RESET_OF (1ULL << 21)
; #define X86_EFLAGS_RESET_CF (1ULL << 22)
; #define X86_EFLAGS_RESET_DF (1ULL << 23)
; #define X86_EFLAGS_RESET_IF (1ULL << 24)
; #define X86_EFLAGS_RESET_SF (1ULL << 25)
; #define X86_EFLAGS_RESET_AF (1ULL << 26)
; #define X86_EFLAGS_RESET_TF (1ULL << 27)
; #define X86_EFLAGS_RESET_NT (1ULL << 28)
; #define X86_EFLAGS_RESET_PF (1ULL << 29)
; #define X86_EFLAGS_SET_CF (1ULL << 30)
; #define X86_EFLAGS_SET_DF (1ULL << 31)
; #define X86_EFLAGS_SET_IF (1ULL << 32)
; #define X86_EFLAGS_TEST_OF (1ULL << 33)
; #define X86_EFLAGS_TEST_SF (1ULL << 34)
; #define X86_EFLAGS_TEST_ZF (1ULL << 35)
; #define X86_EFLAGS_TEST_PF (1ULL << 36)
; #define X86_EFLAGS_TEST_CF (1ULL << 37)
; #define X86_EFLAGS_TEST_NT (1ULL << 38)
; #define X86_EFLAGS_TEST_DF (1ULL << 39)
; #define X86_EFLAGS_UNDEFINED_OF (1ULL << 40)
; #define X86_EFLAGS_UNDEFINED_SF (1ULL << 41)
; #define X86_EFLAGS_UNDEFINED_ZF (1ULL << 42)
; #define X86_EFLAGS_UNDEFINED_PF (1ULL << 43)
; #define X86_EFLAGS_UNDEFINED_AF (1ULL << 44)
; #define X86_EFLAGS_UNDEFINED_CF (1ULL << 45)

; Operand type for instruction's operands
X86_OP_INVALID          EQU 0 ; = CS_OP_INVALID (Uninitialized).
X86_OP_REG              EQU 1 ; = CS_OP_REG (Register operand).
X86_OP_IMM              EQU 2 ; = CS_OP_IMM (Immediate operand).
X86_OP_MEM              EQU 3 ; = CS_OP_MEM (Memory operand).
X86_OP_FP               EQU 4 ; = CS_OP_FP  (Floating-Point operand).

; XOP Code Condition type
X86_XOP_CC_INVALID      EQU 0 ; Uninitialized.
X86_XOP_CC_LT           EQU 1
X86_XOP_CC_LE           EQU 2
X86_XOP_CC_GT           EQU 3
X86_XOP_CC_GE           EQU 4
X86_XOP_CC_EQ           EQU 5
X86_XOP_CC_NEQ          EQU 6
X86_XOP_CC_FALSE        EQU 7
X86_XOP_CC_TRUE         EQU 8

; AVX broadcast type
X86_AVX_BCAST_INVALID   EQU 0 ; Uninitialized.
X86_AVX_BCAST_2         EQU 1 ; AVX512 broadcast type {1to2}
X86_AVX_BCAST_4         EQU 2 ; AVX512 broadcast type {1to4}
X86_AVX_BCAST_8         EQU 3 ; AVX512 broadcast type {1to8}
X86_AVX_BCAST_16        EQU 4 ; AVX512 broadcast type {1to16}

; SSE Code Condition type
X86_SSE_CC_INVALID      EQU 0 ; Uninitialized.
X86_SSE_CC_EQ           EQU 1 ; 
X86_SSE_CC_LT           EQU 2 ; 
X86_SSE_CC_LE           EQU 3 ; 
X86_SSE_CC_UNORD        EQU 4 ; 
X86_SSE_CC_NEQ          EQU 5 ; 
X86_SSE_CC_NLT          EQU 6 ; 
X86_SSE_CC_NLE          EQU 7 ; 
X86_SSE_CC_ORD          EQU 8 ; 


; AVX Code Condition type
X86_AVX_CC_INVALID      EQU 0 ; Uninitialized.
X86_AVX_CC_EQ           EQU 1 ; 
X86_AVX_CC_LT           EQU 2 ; 
X86_AVX_CC_LE           EQU 3 ; 
X86_AVX_CC_UNORD        EQU 4 ; 
X86_AVX_CC_NEQ          EQU 5 ; 
X86_AVX_CC_NLT          EQU 6 ; 
X86_AVX_CC_NLE          EQU 7 ; 
X86_AVX_CC_ORD          EQU 8 ; 
X86_AVX_CC_EQ_UQ        EQU 9 ; 
X86_AVX_CC_NGE          EQU 10 ; 
X86_AVX_CC_NGT          EQU 11 ; 
X86_AVX_CC_FALSE        EQU 12 ; 
X86_AVX_CC_NEQ_OQ       EQU 13 ; 
X86_AVX_CC_GE           EQU 14 ; 
X86_AVX_CC_GT           EQU 15 ; 
X86_AVX_CC_TRUE         EQU 16 ; 
X86_AVX_CC_EQ_OS        EQU 17 ; 
X86_AVX_CC_LT_OQ        EQU 18 ; 
X86_AVX_CC_LE_OQ        EQU 19 ; 
X86_AVX_CC_UNORD_S      EQU 20 ; 
X86_AVX_CC_NEQ_US       EQU 21 ; 
X86_AVX_CC_NLT_UQ       EQU 22 ; 
X86_AVX_CC_NLE_UQ       EQU 23 ; 
X86_AVX_CC_ORD_S        EQU 24 ; 
X86_AVX_CC_EQ_US        EQU 25 ; 
X86_AVX_CC_NGE_UQ       EQU 26 ; 
X86_AVX_CC_NGT_UQ       EQU 27 ; 
X86_AVX_CC_FALSE_OS     EQU 28 ; 
X86_AVX_CC_NEQ_OS       EQU 29 ; 
X86_AVX_CC_GE_OQ        EQU 30 ; 
X86_AVX_CC_GT_OQ        EQU 31 ; 
X86_AVX_CC_TRUE_US      EQU 32 ; 

; AVX static rounding mode type
X86_AVX_RM_INVALID      EQU 0 ; Uninitialized.
X86_AVX_RM_RN           EQU 1 ; Round to nearest
X86_AVX_RM_RD           EQU 2 ; ound down
X86_AVX_RM_RU           EQU 3 ; Round up
X86_AVX_RM_RZ           EQU 4 ; Round toward zero

; Instruction prefixes - to be used in cs_x86.prefix[]
X86_PREFIX_LOCK         EQU 0F0h ; lock (cs_x86.prefix[0]
X86_PREFIX_REP          EQU 0f3h ; rep (cs_x86.prefix[0]
X86_PREFIX_REPNE        EQU 0f2h ; repne (cs_x86.prefix[0]
X86_PREFIX_CS           EQU 02eh ; segment override CS (cs_x86.prefix[1]
X86_PREFIX_SS           EQU 036h ; segment override SS (cs_x86.prefix[1]
X86_PREFIX_DS           EQU 03eh ; segment override DS (cs_x86.prefix[1]
X86_PREFIX_ES           EQU 026h ; segment override ES (cs_x86.prefix[1]
X86_PREFIX_FS           EQU 064h ; segment override FS (cs_x86.prefix[1]
X86_PREFIX_GS           EQU 065h ; segment override GS (cs_x86.prefix[1]
X86_PREFIX_OPSIZE       EQU 066h ; operand-size override (cs_x86.prefix[2]
X86_PREFIX_ADDRSIZE     EQU 067h ; address-size override (cs_x86.prefix[3]

; Instruction's operand referring to memory. This is associated with X86_OP_MEM operand type above
x86_op_mem              STRUCT
    segment             DWORD ? ; segment register (or X86_REG_INVALID if irrelevant)
    base                DWORD ? ; base register (or X86_REG_INVALID if irrelevant)
    index               DWORD ? ; index register (or X86_REG_INVALID if irrelevant)
    scale               DWORD ? ; scale for index register
    disp                QWORD ? ; int64_t displacement value
x86_op_mem              ENDS

; Instruction operand
cs_x86_op               STRUCT 8
    type_               x86_op_type ?   ; operand type
    reg                 x86_reg ?       ; register value for REG operand
    imm                 QWORD ?         ; int64_t - immediate value for IMM operand
    fp                  double ?        ; floating point value for FP operand
    mem                 x86_op_mem ?    ; base/index/scale/disp value for MEM operand
    size_               BYTE ?          ; uint8_t - size of this operand (in bytes).
    access              BYTE ?          ; uint8_t - How is this operand accessed? (READ, WRITE or READ|WRITE)This field is combined of cs_ac_type.
    avx_bcast           x86_avx_bcast ? ; AVX broadcast type, or 0 if irrelevant
    avx_zero_opmask     DWORD ?         ; bool AVX zero opmask {z}
cs_x86_op               ENDS

; Instruction structure
cs_x86                  STRUCT 8
    prefix              DB 4 DUP (?)    ; uint8_t Instruction prefix, which can be up to 4 bytes.
    opcode              DB 4 DUP (?)    ; uint8_t Instruction opcode, wich can be from 1 to 4 bytes in size. This contains VEX opcode as well.
    rex                 BYTE ?          ; uint8_t REX prefix: only a non-zero value is relavant for x86_64
    addr_size           BYTE ?          ; uint8_t Address size, which can be overrided with above prefix[5].
    modrm               BYTE ?          ; uint8_t ModR/M byte
    sib                 BYTE ?          ; uint8_t SIB value, or 0 when irrelevant.
    disp                DWORD ?         ; int32_t Displacement value, or 0 when irrelevant.
    sib_index           x86_reg ?       ; SIB state SIB index register, or X86_REG_INVALID when irrelevant.
    sib_scale           BYTE ?          ; int8_t SIB scale. only applicable if sib_index is relavant.
    sib_base            x86_reg ?       ; SIB base register, or X86_REG_INVALID when irrelevant.
    xop_cc              x86_xop_cc ?    ; XOP Code Condition
    sse_cc              x86_sse_cc ?    ; SSE Code Condition
    avx_cc              x86_avx_cc ?    ; AVX Code Condition
    avx_sae             DWORD ?         ; bool AVX Suppress all Exception
    avx_rm              x86_avx_rm ?    ; AVX static rounding mode
    eflags              QWORD ?         ; unit64_t EFLAGS updated by this instruction.
    op_count            BYTE ?          ; uint8_t Number of operands of this instruction, or 0 when instruction has no operand.
    operands            cs_x86_op 8 dup ({}) ; operands for this instruction.
cs_x86                  ENDS

; X86 instructions
X86_INS_INVALID         EQU 0
X86_INS_AAA,
X86_INS_AAD,
X86_INS_AAM,
X86_INS_AAS,
X86_INS_FABS,
X86_INS_ADC,
X86_INS_ADCX,
X86_INS_ADD,
X86_INS_ADDPD,
X86_INS_ADDPS,
X86_INS_ADDSD,
X86_INS_ADDSS,
X86_INS_ADDSUBPD,
X86_INS_ADDSUBPS,
X86_INS_FADD,
X86_INS_FIADD,
X86_INS_FADDP,
X86_INS_ADOX,
X86_INS_AESDECLAST,
X86_INS_AESDEC,
X86_INS_AESENCLAST,
X86_INS_AESENC,
X86_INS_AESIMC,
X86_INS_AESKEYGENASSIST,
X86_INS_AND,
X86_INS_ANDN,
X86_INS_ANDNPD,
X86_INS_ANDNPS,
X86_INS_ANDPD,
X86_INS_ANDPS,
X86_INS_ARPL,
X86_INS_BEXTR,
X86_INS_BLCFILL,
X86_INS_BLCI,
X86_INS_BLCIC,
X86_INS_BLCMSK,
X86_INS_BLCS,
X86_INS_BLENDPD,
X86_INS_BLENDPS,
X86_INS_BLENDVPD,
X86_INS_BLENDVPS,
X86_INS_BLSFILL,
X86_INS_BLSI,
X86_INS_BLSIC,
X86_INS_BLSMSK,
X86_INS_BLSR,
X86_INS_BOUND,
X86_INS_BSF,
X86_INS_BSR,
X86_INS_BSWAP,
X86_INS_BT,
X86_INS_BTC,
X86_INS_BTR,
X86_INS_BTS,
X86_INS_BZHI,
X86_INS_CALL,
X86_INS_CBW,
X86_INS_CDQ,
X86_INS_CDQE,
X86_INS_FCHS,
X86_INS_CLAC,
X86_INS_CLC,
X86_INS_CLD,
X86_INS_CLFLUSH,
X86_INS_CLFLUSHOPT,
X86_INS_CLGI,
X86_INS_CLI,
X86_INS_CLTS,
X86_INS_CLWB,
X86_INS_CMC,
X86_INS_CMOVA,
X86_INS_CMOVAE,
X86_INS_CMOVB,
X86_INS_CMOVBE,
X86_INS_FCMOVBE,
X86_INS_FCMOVB,
X86_INS_CMOVE,
X86_INS_FCMOVE,
X86_INS_CMOVG,
X86_INS_CMOVGE,
X86_INS_CMOVL,
X86_INS_CMOVLE,
X86_INS_FCMOVNBE,
X86_INS_FCMOVNB,
X86_INS_CMOVNE,
X86_INS_FCMOVNE,
X86_INS_CMOVNO,
X86_INS_CMOVNP,
X86_INS_FCMOVNU,
X86_INS_CMOVNS,
X86_INS_CMOVO,
X86_INS_CMOVP,
X86_INS_FCMOVU,
X86_INS_CMOVS,
X86_INS_CMP,
X86_INS_CMPPD,
X86_INS_CMPPS,
X86_INS_CMPSB,
X86_INS_CMPSD,
X86_INS_CMPSQ,
X86_INS_CMPSS,
X86_INS_CMPSW,
X86_INS_CMPXCHG16B,
X86_INS_CMPXCHG,
X86_INS_CMPXCHG8B,
X86_INS_COMISD,
X86_INS_COMISS,
X86_INS_FCOMP,
X86_INS_FCOMPI,
X86_INS_FCOMI,
X86_INS_FCOM,
X86_INS_FCOS,
X86_INS_CPUID,
X86_INS_CQO,
X86_INS_CRC32,
X86_INS_CVTDQ2PD,
X86_INS_CVTDQ2PS,
X86_INS_CVTPD2DQ,
X86_INS_CVTPD2PS,
X86_INS_CVTPS2DQ,
X86_INS_CVTPS2PD,
X86_INS_CVTSD2SI,
X86_INS_CVTSD2SS,
X86_INS_CVTSI2SD,
X86_INS_CVTSI2SS,
X86_INS_CVTSS2SD,
X86_INS_CVTSS2SI,
X86_INS_CVTTPD2DQ,
X86_INS_CVTTPS2DQ,
X86_INS_CVTTSD2SI,
X86_INS_CVTTSS2SI,
X86_INS_CWD,
X86_INS_CWDE,
X86_INS_DAA,
X86_INS_DAS,
X86_INS_DATA16,
X86_INS_DEC,
X86_INS_DIV,
X86_INS_DIVPD,
X86_INS_DIVPS,
X86_INS_FDIVR,
X86_INS_FIDIVR,
X86_INS_FDIVRP,
X86_INS_DIVSD,
X86_INS_DIVSS,
X86_INS_FDIV,
X86_INS_FIDIV,
X86_INS_FDIVP,
X86_INS_DPPD,
X86_INS_DPPS,
X86_INS_RET,
X86_INS_ENCLS,
X86_INS_ENCLU,
X86_INS_ENTER,
X86_INS_EXTRACTPS,
X86_INS_EXTRQ,
X86_INS_F2XM1,
X86_INS_LCALL,
X86_INS_LJMP,
X86_INS_FBLD,
X86_INS_FBSTP,
X86_INS_FCOMPP,
X86_INS_FDECSTP,
X86_INS_FEMMS,
X86_INS_FFREE,
X86_INS_FICOM,
X86_INS_FICOMP,
X86_INS_FINCSTP,
X86_INS_FLDCW,
X86_INS_FLDENV,
X86_INS_FLDL2E,
X86_INS_FLDL2T,
X86_INS_FLDLG2,
X86_INS_FLDLN2,
X86_INS_FLDPI,
X86_INS_FNCLEX,
X86_INS_FNINIT,
X86_INS_FNOP,
X86_INS_FNSTCW,
X86_INS_FNSTSW,
X86_INS_FPATAN,
X86_INS_FPREM,
X86_INS_FPREM1,
X86_INS_FPTAN,
X86_INS_FFREEP,
X86_INS_FRNDINT,
X86_INS_FRSTOR,
X86_INS_FNSAVE,
X86_INS_FSCALE,
X86_INS_FSETPM,
X86_INS_FSINCOS,
X86_INS_FNSTENV,
X86_INS_FXAM,
X86_INS_FXRSTOR,
X86_INS_FXRSTOR64,
X86_INS_FXSAVE,
X86_INS_FXSAVE64,
X86_INS_FXTRACT,
X86_INS_FYL2X,
X86_INS_FYL2XP1,
X86_INS_MOVAPD,
X86_INS_MOVAPS,
X86_INS_ORPD,
X86_INS_ORPS,
X86_INS_VMOVAPD,
X86_INS_VMOVAPS,
X86_INS_XORPD,
X86_INS_XORPS,
X86_INS_GETSEC,
X86_INS_HADDPD,
X86_INS_HADDPS,
X86_INS_HLT,
X86_INS_HSUBPD,
X86_INS_HSUBPS,
X86_INS_IDIV,
X86_INS_FILD,
X86_INS_IMUL,
X86_INS_IN,
X86_INS_INC,
X86_INS_INSB,
X86_INS_INSERTPS,
X86_INS_INSERTQ,
X86_INS_INSD,
X86_INS_INSW,
X86_INS_INT,
X86_INS_INT1,
X86_INS_INT3,
X86_INS_INTO,
X86_INS_INVD,
X86_INS_INVEPT,
X86_INS_INVLPG,
X86_INS_INVLPGA,
X86_INS_INVPCID,
X86_INS_INVVPID,
X86_INS_IRET,
X86_INS_IRETD,
X86_INS_IRETQ,
X86_INS_FISTTP,
X86_INS_FIST,
X86_INS_FISTP,
X86_INS_UCOMISD,
X86_INS_UCOMISS,
X86_INS_VCOMISD,
X86_INS_VCOMISS,
X86_INS_VCVTSD2SS,
X86_INS_VCVTSI2SD,
X86_INS_VCVTSI2SS,
X86_INS_VCVTSS2SD,
X86_INS_VCVTTSD2SI,
X86_INS_VCVTTSD2USI,
X86_INS_VCVTTSS2SI,
X86_INS_VCVTTSS2USI,
X86_INS_VCVTUSI2SD,
X86_INS_VCVTUSI2SS,
X86_INS_VUCOMISD,
X86_INS_VUCOMISS,
X86_INS_JAE,
X86_INS_JA,
X86_INS_JBE,
X86_INS_JB,
X86_INS_JCXZ,
X86_INS_JECXZ,
X86_INS_JE,
X86_INS_JGE,
X86_INS_JG,
X86_INS_JLE,
X86_INS_JL,
X86_INS_JMP,
X86_INS_JNE,
X86_INS_JNO,
X86_INS_JNP,
X86_INS_JNS,
X86_INS_JO,
X86_INS_JP,
X86_INS_JRCXZ,
X86_INS_JS,
X86_INS_KANDB,
X86_INS_KANDD,
X86_INS_KANDNB,
X86_INS_KANDND,
X86_INS_KANDNQ,
X86_INS_KANDNW,
X86_INS_KANDQ,
X86_INS_KANDW,
X86_INS_KMOVB,
X86_INS_KMOVD,
X86_INS_KMOVQ,
X86_INS_KMOVW,
X86_INS_KNOTB,
X86_INS_KNOTD,
X86_INS_KNOTQ,
X86_INS_KNOTW,
X86_INS_KORB,
X86_INS_KORD,
X86_INS_KORQ,
X86_INS_KORTESTB,
X86_INS_KORTESTD,
X86_INS_KORTESTQ,
X86_INS_KORTESTW,
X86_INS_KORW,
X86_INS_KSHIFTLB,
X86_INS_KSHIFTLD,
X86_INS_KSHIFTLQ,
X86_INS_KSHIFTLW,
X86_INS_KSHIFTRB,
X86_INS_KSHIFTRD,
X86_INS_KSHIFTRQ,
X86_INS_KSHIFTRW,
X86_INS_KUNPCKBW,
X86_INS_KXNORB,
X86_INS_KXNORD,
X86_INS_KXNORQ,
X86_INS_KXNORW,
X86_INS_KXORB,
X86_INS_KXORD,
X86_INS_KXORQ,
X86_INS_KXORW,
X86_INS_LAHF,
X86_INS_LAR,
X86_INS_LDDQU,
X86_INS_LDMXCSR,
X86_INS_LDS,
X86_INS_FLDZ,
X86_INS_FLD1,
X86_INS_FLD,
X86_INS_LEA,
X86_INS_LEAVE,
X86_INS_LES,
X86_INS_LFENCE,
X86_INS_LFS,
X86_INS_LGDT,
X86_INS_LGS,
X86_INS_LIDT,
X86_INS_LLDT,
X86_INS_LMSW,
X86_INS_OR,
X86_INS_SUB,
X86_INS_XOR,
X86_INS_LODSB,
X86_INS_LODSD,
X86_INS_LODSQ,
X86_INS_LODSW,
X86_INS_LOOP,
X86_INS_LOOPE,
X86_INS_LOOPNE,
X86_INS_RETF,
X86_INS_RETFQ,
X86_INS_LSL,
X86_INS_LSS,
X86_INS_LTR,
X86_INS_XADD,
X86_INS_LZCNT,
X86_INS_MASKMOVDQU,
X86_INS_MAXPD,
X86_INS_MAXPS,
X86_INS_MAXSD,
X86_INS_MAXSS,
X86_INS_MFENCE,
X86_INS_MINPD,
X86_INS_MINPS,
X86_INS_MINSD,
X86_INS_MINSS,
X86_INS_CVTPD2PI,
X86_INS_CVTPI2PD,
X86_INS_CVTPI2PS,
X86_INS_CVTPS2PI,
X86_INS_CVTTPD2PI,
X86_INS_CVTTPS2PI,
X86_INS_EMMS,
X86_INS_MASKMOVQ,
X86_INS_MOVD,
X86_INS_MOVDQ2Q,
X86_INS_MOVNTQ,
X86_INS_MOVQ2DQ,
X86_INS_MOVQ,
X86_INS_PABSB,
X86_INS_PABSD,
X86_INS_PABSW,
X86_INS_PACKSSDW,
X86_INS_PACKSSWB,
X86_INS_PACKUSWB,
X86_INS_PADDB,
X86_INS_PADDD,
X86_INS_PADDQ,
X86_INS_PADDSB,
X86_INS_PADDSW,
X86_INS_PADDUSB,
X86_INS_PADDUSW,
X86_INS_PADDW,
X86_INS_PALIGNR,
X86_INS_PANDN,
X86_INS_PAND,
X86_INS_PAVGB,
X86_INS_PAVGW,
X86_INS_PCMPEQB,
X86_INS_PCMPEQD,
X86_INS_PCMPEQW,
X86_INS_PCMPGTB,
X86_INS_PCMPGTD,
X86_INS_PCMPGTW,
X86_INS_PEXTRW,
X86_INS_PHADDSW,
X86_INS_PHADDW,
X86_INS_PHADDD,
X86_INS_PHSUBD,
X86_INS_PHSUBSW,
X86_INS_PHSUBW,
X86_INS_PINSRW,
X86_INS_PMADDUBSW,
X86_INS_PMADDWD,
X86_INS_PMAXSW,
X86_INS_PMAXUB,
X86_INS_PMINSW,
X86_INS_PMINUB,
X86_INS_PMOVMSKB,
X86_INS_PMULHRSW,
X86_INS_PMULHUW,
X86_INS_PMULHW,
X86_INS_PMULLW,
X86_INS_PMULUDQ,
X86_INS_POR,
X86_INS_PSADBW,
X86_INS_PSHUFB,
X86_INS_PSHUFW,
X86_INS_PSIGNB,
X86_INS_PSIGND,
X86_INS_PSIGNW,
X86_INS_PSLLD,
X86_INS_PSLLQ,
X86_INS_PSLLW,
X86_INS_PSRAD,
X86_INS_PSRAW,
X86_INS_PSRLD,
X86_INS_PSRLQ,
X86_INS_PSRLW,
X86_INS_PSUBB,
X86_INS_PSUBD,
X86_INS_PSUBQ,
X86_INS_PSUBSB,
X86_INS_PSUBSW,
X86_INS_PSUBUSB,
X86_INS_PSUBUSW,
X86_INS_PSUBW,
X86_INS_PUNPCKHBW,
X86_INS_PUNPCKHDQ,
X86_INS_PUNPCKHWD,
X86_INS_PUNPCKLBW,
X86_INS_PUNPCKLDQ,
X86_INS_PUNPCKLWD,
X86_INS_PXOR,
X86_INS_MONITOR,
X86_INS_MONTMUL,
X86_INS_MOV,
X86_INS_MOVABS,
X86_INS_MOVBE,
X86_INS_MOVDDUP,
X86_INS_MOVDQA,
X86_INS_MOVDQU,
X86_INS_MOVHLPS,
X86_INS_MOVHPD,
X86_INS_MOVHPS,
X86_INS_MOVLHPS,
X86_INS_MOVLPD,
X86_INS_MOVLPS,
X86_INS_MOVMSKPD,
X86_INS_MOVMSKPS,
X86_INS_MOVNTDQA,
X86_INS_MOVNTDQ,
X86_INS_MOVNTI,
X86_INS_MOVNTPD,
X86_INS_MOVNTPS,
X86_INS_MOVNTSD,
X86_INS_MOVNTSS,
X86_INS_MOVSB,
X86_INS_MOVSD,
X86_INS_MOVSHDUP,
X86_INS_MOVSLDUP,
X86_INS_MOVSQ,
X86_INS_MOVSS,
X86_INS_MOVSW,
X86_INS_MOVSX,
X86_INS_MOVSXD,
X86_INS_MOVUPD,
X86_INS_MOVUPS,
X86_INS_MOVZX,
X86_INS_MPSADBW,
X86_INS_MUL,
X86_INS_MULPD,
X86_INS_MULPS,
X86_INS_MULSD,
X86_INS_MULSS,
X86_INS_MULX,
X86_INS_FMUL,
X86_INS_FIMUL,
X86_INS_FMULP,
X86_INS_MWAIT,
X86_INS_NEG,
X86_INS_NOP,
X86_INS_NOT,
X86_INS_OUT,
X86_INS_OUTSB,
X86_INS_OUTSD,
X86_INS_OUTSW,
X86_INS_PACKUSDW,
X86_INS_PAUSE,
X86_INS_PAVGUSB,
X86_INS_PBLENDVB,
X86_INS_PBLENDW,
X86_INS_PCLMULQDQ,
X86_INS_PCMPEQQ,
X86_INS_PCMPESTRI,
X86_INS_PCMPESTRM,
X86_INS_PCMPGTQ,
X86_INS_PCMPISTRI,
X86_INS_PCMPISTRM,
X86_INS_PCOMMIT,
X86_INS_PDEP,
X86_INS_PEXT,
X86_INS_PEXTRB,
X86_INS_PEXTRD,
X86_INS_PEXTRQ,
X86_INS_PF2ID,
X86_INS_PF2IW,
X86_INS_PFACC,
X86_INS_PFADD,
X86_INS_PFCMPEQ,
X86_INS_PFCMPGE,
X86_INS_PFCMPGT,
X86_INS_PFMAX,
X86_INS_PFMIN,
X86_INS_PFMUL,
X86_INS_PFNACC,
X86_INS_PFPNACC,
X86_INS_PFRCPIT1,
X86_INS_PFRCPIT2,
X86_INS_PFRCP,
X86_INS_PFRSQIT1,
X86_INS_PFRSQRT,
X86_INS_PFSUBR,
X86_INS_PFSUB,
X86_INS_PHMINPOSUW,
X86_INS_PI2FD,
X86_INS_PI2FW,
X86_INS_PINSRB,
X86_INS_PINSRD,
X86_INS_PINSRQ,
X86_INS_PMAXSB,
X86_INS_PMAXSD,
X86_INS_PMAXUD,
X86_INS_PMAXUW,
X86_INS_PMINSB,
X86_INS_PMINSD,
X86_INS_PMINUD,
X86_INS_PMINUW,
X86_INS_PMOVSXBD,
X86_INS_PMOVSXBQ,
X86_INS_PMOVSXBW,
X86_INS_PMOVSXDQ,
X86_INS_PMOVSXWD,
X86_INS_PMOVSXWQ,
X86_INS_PMOVZXBD,
X86_INS_PMOVZXBQ,
X86_INS_PMOVZXBW,
X86_INS_PMOVZXDQ,
X86_INS_PMOVZXWD,
X86_INS_PMOVZXWQ,
X86_INS_PMULDQ,
X86_INS_PMULHRW,
X86_INS_PMULLD,
X86_INS_POP,
X86_INS_POPAW,
X86_INS_POPAL,
X86_INS_POPCNT,
X86_INS_POPF,
X86_INS_POPFD,
X86_INS_POPFQ,
X86_INS_PREFETCH,
X86_INS_PREFETCHNTA,
X86_INS_PREFETCHT0,
X86_INS_PREFETCHT1,
X86_INS_PREFETCHT2,
X86_INS_PREFETCHW,
X86_INS_PSHUFD,
X86_INS_PSHUFHW,
X86_INS_PSHUFLW,
X86_INS_PSLLDQ,
X86_INS_PSRLDQ,
X86_INS_PSWAPD,
X86_INS_PTEST,
X86_INS_PUNPCKHQDQ,
X86_INS_PUNPCKLQDQ,
X86_INS_PUSH,
X86_INS_PUSHAW,
X86_INS_PUSHAL,
X86_INS_PUSHF,
X86_INS_PUSHFD,
X86_INS_PUSHFQ,
X86_INS_RCL,
X86_INS_RCPPS,
X86_INS_RCPSS,
X86_INS_RCR,
X86_INS_RDFSBASE,
X86_INS_RDGSBASE,
X86_INS_RDMSR,
X86_INS_RDPMC,
X86_INS_RDRAND,
X86_INS_RDSEED,
X86_INS_RDTSC,
X86_INS_RDTSCP,
X86_INS_ROL,
X86_INS_ROR,
X86_INS_RORX,
X86_INS_ROUNDPD,
X86_INS_ROUNDPS,
X86_INS_ROUNDSD,
X86_INS_ROUNDSS,
X86_INS_RSM,
X86_INS_RSQRTPS,
X86_INS_RSQRTSS,
X86_INS_SAHF,
X86_INS_SAL,
X86_INS_SALC,
X86_INS_SAR,
X86_INS_SARX,
X86_INS_SBB,
X86_INS_SCASB,
X86_INS_SCASD,
X86_INS_SCASQ,
X86_INS_SCASW,
X86_INS_SETAE,
X86_INS_SETA,
X86_INS_SETBE,
X86_INS_SETB,
X86_INS_SETE,
X86_INS_SETGE,
X86_INS_SETG,
X86_INS_SETLE,
X86_INS_SETL,
X86_INS_SETNE,
X86_INS_SETNO,
X86_INS_SETNP,
X86_INS_SETNS,
X86_INS_SETO,
X86_INS_SETP,
X86_INS_SETS,
X86_INS_SFENCE,
X86_INS_SGDT,
X86_INS_SHA1MSG1,
X86_INS_SHA1MSG2,
X86_INS_SHA1NEXTE,
X86_INS_SHA1RNDS4,
X86_INS_SHA256MSG1,
X86_INS_SHA256MSG2,
X86_INS_SHA256RNDS2,
X86_INS_SHL,
X86_INS_SHLD,
X86_INS_SHLX,
X86_INS_SHR,
X86_INS_SHRD,
X86_INS_SHRX,
X86_INS_SHUFPD,
X86_INS_SHUFPS,
X86_INS_SIDT,
X86_INS_FSIN,
X86_INS_SKINIT,
X86_INS_SLDT,
X86_INS_SMSW,
X86_INS_SQRTPD,
X86_INS_SQRTPS,
X86_INS_SQRTSD,
X86_INS_SQRTSS,
X86_INS_FSQRT,
X86_INS_STAC,
X86_INS_STC,
X86_INS_STD,
X86_INS_STGI,
X86_INS_STI,
X86_INS_STMXCSR,
X86_INS_STOSB,
X86_INS_STOSD,
X86_INS_STOSQ,
X86_INS_STOSW,
X86_INS_STR,
X86_INS_FST,
X86_INS_FSTP,
X86_INS_FSTPNCE,
X86_INS_FXCH,
X86_INS_SUBPD,
X86_INS_SUBPS,
X86_INS_FSUBR,
X86_INS_FISUBR,
X86_INS_FSUBRP,
X86_INS_SUBSD,
X86_INS_SUBSS,
X86_INS_FSUB,
X86_INS_FISUB,
X86_INS_FSUBP,
X86_INS_SWAPGS,
X86_INS_SYSCALL,
X86_INS_SYSENTER,
X86_INS_SYSEXIT,
X86_INS_SYSRET,
X86_INS_T1MSKC,
X86_INS_TEST,
X86_INS_UD2,
X86_INS_FTST,
X86_INS_TZCNT,
X86_INS_TZMSK,
X86_INS_FUCOMPI,
X86_INS_FUCOMI,
X86_INS_FUCOMPP,
X86_INS_FUCOMP,
X86_INS_FUCOM,
X86_INS_UD2B,
X86_INS_UNPCKHPD,
X86_INS_UNPCKHPS,
X86_INS_UNPCKLPD,
X86_INS_UNPCKLPS,
X86_INS_VADDPD,
X86_INS_VADDPS,
X86_INS_VADDSD,
X86_INS_VADDSS,
X86_INS_VADDSUBPD,
X86_INS_VADDSUBPS,
X86_INS_VAESDECLAST,
X86_INS_VAESDEC,
X86_INS_VAESENCLAST,
X86_INS_VAESENC,
X86_INS_VAESIMC,
X86_INS_VAESKEYGENASSIST,
X86_INS_VALIGND,
X86_INS_VALIGNQ,
X86_INS_VANDNPD,
X86_INS_VANDNPS,
X86_INS_VANDPD,
X86_INS_VANDPS,
X86_INS_VBLENDMPD,
X86_INS_VBLENDMPS,
X86_INS_VBLENDPD,
X86_INS_VBLENDPS,
X86_INS_VBLENDVPD,
X86_INS_VBLENDVPS,
X86_INS_VBROADCASTF128,
X86_INS_VBROADCASTI32X4,
X86_INS_VBROADCASTI64X4,
X86_INS_VBROADCASTSD,
X86_INS_VBROADCASTSS,
X86_INS_VCMPPD,
X86_INS_VCMPPS,
X86_INS_VCMPSD,
X86_INS_VCMPSS,
X86_INS_VCOMPRESSPD,
X86_INS_VCOMPRESSPS,
X86_INS_VCVTDQ2PD,
X86_INS_VCVTDQ2PS,
X86_INS_VCVTPD2DQX,
X86_INS_VCVTPD2DQ,
X86_INS_VCVTPD2PSX,
X86_INS_VCVTPD2PS,
X86_INS_VCVTPD2UDQ,
X86_INS_VCVTPH2PS,
X86_INS_VCVTPS2DQ,
X86_INS_VCVTPS2PD,
X86_INS_VCVTPS2PH,
X86_INS_VCVTPS2UDQ,
X86_INS_VCVTSD2SI,
X86_INS_VCVTSD2USI,
X86_INS_VCVTSS2SI,
X86_INS_VCVTSS2USI,
X86_INS_VCVTTPD2DQX,
X86_INS_VCVTTPD2DQ,
X86_INS_VCVTTPD2UDQ,
X86_INS_VCVTTPS2DQ,
X86_INS_VCVTTPS2UDQ,
X86_INS_VCVTUDQ2PD,
X86_INS_VCVTUDQ2PS,
X86_INS_VDIVPD,
X86_INS_VDIVPS,
X86_INS_VDIVSD,
X86_INS_VDIVSS,
X86_INS_VDPPD,
X86_INS_VDPPS,
X86_INS_VERR,
X86_INS_VERW,
X86_INS_VEXP2PD,
X86_INS_VEXP2PS,
X86_INS_VEXPANDPD,
X86_INS_VEXPANDPS,
X86_INS_VEXTRACTF128,
X86_INS_VEXTRACTF32X4,
X86_INS_VEXTRACTF64X4,
X86_INS_VEXTRACTI128,
X86_INS_VEXTRACTI32X4,
X86_INS_VEXTRACTI64X4,
X86_INS_VEXTRACTPS,
X86_INS_VFMADD132PD,
X86_INS_VFMADD132PS,
X86_INS_VFMADDPD,
X86_INS_VFMADD213PD,
X86_INS_VFMADD231PD,
X86_INS_VFMADDPS,
X86_INS_VFMADD213PS,
X86_INS_VFMADD231PS,
X86_INS_VFMADDSD,
X86_INS_VFMADD213SD,
X86_INS_VFMADD132SD,
X86_INS_VFMADD231SD,
X86_INS_VFMADDSS,
X86_INS_VFMADD213SS,
X86_INS_VFMADD132SS,
X86_INS_VFMADD231SS,
X86_INS_VFMADDSUB132PD,
X86_INS_VFMADDSUB132PS,
X86_INS_VFMADDSUBPD,
X86_INS_VFMADDSUB213PD,
X86_INS_VFMADDSUB231PD,
X86_INS_VFMADDSUBPS,
X86_INS_VFMADDSUB213PS,
X86_INS_VFMADDSUB231PS,
X86_INS_VFMSUB132PD,
X86_INS_VFMSUB132PS,
X86_INS_VFMSUBADD132PD,
X86_INS_VFMSUBADD132PS,
X86_INS_VFMSUBADDPD,
X86_INS_VFMSUBADD213PD,
X86_INS_VFMSUBADD231PD,
X86_INS_VFMSUBADDPS,
X86_INS_VFMSUBADD213PS,
X86_INS_VFMSUBADD231PS,
X86_INS_VFMSUBPD,
X86_INS_VFMSUB213PD,
X86_INS_VFMSUB231PD,
X86_INS_VFMSUBPS,
X86_INS_VFMSUB213PS,
X86_INS_VFMSUB231PS,
X86_INS_VFMSUBSD,
X86_INS_VFMSUB213SD,
X86_INS_VFMSUB132SD,
X86_INS_VFMSUB231SD,
X86_INS_VFMSUBSS,
X86_INS_VFMSUB213SS,
X86_INS_VFMSUB132SS,
X86_INS_VFMSUB231SS,
X86_INS_VFNMADD132PD,
X86_INS_VFNMADD132PS,
X86_INS_VFNMADDPD,
X86_INS_VFNMADD213PD,
X86_INS_VFNMADD231PD,
X86_INS_VFNMADDPS,
X86_INS_VFNMADD213PS,
X86_INS_VFNMADD231PS,
X86_INS_VFNMADDSD,
X86_INS_VFNMADD213SD,
X86_INS_VFNMADD132SD,
X86_INS_VFNMADD231SD,
X86_INS_VFNMADDSS,
X86_INS_VFNMADD213SS,
X86_INS_VFNMADD132SS,
X86_INS_VFNMADD231SS,
X86_INS_VFNMSUB132PD,
X86_INS_VFNMSUB132PS,
X86_INS_VFNMSUBPD,
X86_INS_VFNMSUB213PD,
X86_INS_VFNMSUB231PD,
X86_INS_VFNMSUBPS,
X86_INS_VFNMSUB213PS,
X86_INS_VFNMSUB231PS,
X86_INS_VFNMSUBSD,
X86_INS_VFNMSUB213SD,
X86_INS_VFNMSUB132SD,
X86_INS_VFNMSUB231SD,
X86_INS_VFNMSUBSS,
X86_INS_VFNMSUB213SS,
X86_INS_VFNMSUB132SS,
X86_INS_VFNMSUB231SS,
X86_INS_VFRCZPD,
X86_INS_VFRCZPS,
X86_INS_VFRCZSD,
X86_INS_VFRCZSS,
X86_INS_VORPD,
X86_INS_VORPS,
X86_INS_VXORPD,
X86_INS_VXORPS,
X86_INS_VGATHERDPD,
X86_INS_VGATHERDPS,
X86_INS_VGATHERPF0DPD,
X86_INS_VGATHERPF0DPS,
X86_INS_VGATHERPF0QPD,
X86_INS_VGATHERPF0QPS,
X86_INS_VGATHERPF1DPD,
X86_INS_VGATHERPF1DPS,
X86_INS_VGATHERPF1QPD,
X86_INS_VGATHERPF1QPS,
X86_INS_VGATHERQPD,
X86_INS_VGATHERQPS,
X86_INS_VHADDPD,
X86_INS_VHADDPS,
X86_INS_VHSUBPD,
X86_INS_VHSUBPS,
X86_INS_VINSERTF128,
X86_INS_VINSERTF32X4,
X86_INS_VINSERTF32X8,
X86_INS_VINSERTF64X2,
X86_INS_VINSERTF64X4,
X86_INS_VINSERTI128,
X86_INS_VINSERTI32X4,
X86_INS_VINSERTI32X8,
X86_INS_VINSERTI64X2,
X86_INS_VINSERTI64X4,
X86_INS_VINSERTPS,
X86_INS_VLDDQU,
X86_INS_VLDMXCSR,
X86_INS_VMASKMOVDQU,
X86_INS_VMASKMOVPD,
X86_INS_VMASKMOVPS,
X86_INS_VMAXPD,
X86_INS_VMAXPS,
X86_INS_VMAXSD,
X86_INS_VMAXSS,
X86_INS_VMCALL,
X86_INS_VMCLEAR,
X86_INS_VMFUNC,
X86_INS_VMINPD,
X86_INS_VMINPS,
X86_INS_VMINSD,
X86_INS_VMINSS,
X86_INS_VMLAUNCH,
X86_INS_VMLOAD,
X86_INS_VMMCALL,
X86_INS_VMOVQ,
X86_INS_VMOVDDUP,
X86_INS_VMOVD,
X86_INS_VMOVDQA32,
X86_INS_VMOVDQA64,
X86_INS_VMOVDQA,
X86_INS_VMOVDQU16,
X86_INS_VMOVDQU32,
X86_INS_VMOVDQU64,
X86_INS_VMOVDQU8,
X86_INS_VMOVDQU,
X86_INS_VMOVHLPS,
X86_INS_VMOVHPD,
X86_INS_VMOVHPS,
X86_INS_VMOVLHPS,
X86_INS_VMOVLPD,
X86_INS_VMOVLPS,
X86_INS_VMOVMSKPD,
X86_INS_VMOVMSKPS,
X86_INS_VMOVNTDQA,
X86_INS_VMOVNTDQ,
X86_INS_VMOVNTPD,
X86_INS_VMOVNTPS,
X86_INS_VMOVSD,
X86_INS_VMOVSHDUP,
X86_INS_VMOVSLDUP,
X86_INS_VMOVSS,
X86_INS_VMOVUPD,
X86_INS_VMOVUPS,
X86_INS_VMPSADBW,
X86_INS_VMPTRLD,
X86_INS_VMPTRST,
X86_INS_VMREAD,
X86_INS_VMRESUME,
X86_INS_VMRUN,
X86_INS_VMSAVE,
X86_INS_VMULPD,
X86_INS_VMULPS,
X86_INS_VMULSD,
X86_INS_VMULSS,
X86_INS_VMWRITE,
X86_INS_VMXOFF,
X86_INS_VMXON,
X86_INS_VPABSB,
X86_INS_VPABSD,
X86_INS_VPABSQ,
X86_INS_VPABSW,
X86_INS_VPACKSSDW,
X86_INS_VPACKSSWB,
X86_INS_VPACKUSDW,
X86_INS_VPACKUSWB,
X86_INS_VPADDB,
X86_INS_VPADDD,
X86_INS_VPADDQ,
X86_INS_VPADDSB,
X86_INS_VPADDSW,
X86_INS_VPADDUSB,
X86_INS_VPADDUSW,
X86_INS_VPADDW,
X86_INS_VPALIGNR,
X86_INS_VPANDD,
X86_INS_VPANDND,
X86_INS_VPANDNQ,
X86_INS_VPANDN,
X86_INS_VPANDQ,
X86_INS_VPAND,
X86_INS_VPAVGB,
X86_INS_VPAVGW,
X86_INS_VPBLENDD,
X86_INS_VPBLENDMB,
X86_INS_VPBLENDMD,
X86_INS_VPBLENDMQ,
X86_INS_VPBLENDMW,
X86_INS_VPBLENDVB,
X86_INS_VPBLENDW,
X86_INS_VPBROADCASTB,
X86_INS_VPBROADCASTD,
X86_INS_VPBROADCASTMB2Q,
X86_INS_VPBROADCASTMW2D,
X86_INS_VPBROADCASTQ,
X86_INS_VPBROADCASTW,
X86_INS_VPCLMULQDQ,
X86_INS_VPCMOV,
X86_INS_VPCMPB,
X86_INS_VPCMPD,
X86_INS_VPCMPEQB,
X86_INS_VPCMPEQD,
X86_INS_VPCMPEQQ,
X86_INS_VPCMPEQW,
X86_INS_VPCMPESTRI,
X86_INS_VPCMPESTRM,
X86_INS_VPCMPGTB,
X86_INS_VPCMPGTD,
X86_INS_VPCMPGTQ,
X86_INS_VPCMPGTW,
X86_INS_VPCMPISTRI,
X86_INS_VPCMPISTRM,
X86_INS_VPCMPQ,
X86_INS_VPCMPUB,
X86_INS_VPCMPUD,
X86_INS_VPCMPUQ,
X86_INS_VPCMPUW,
X86_INS_VPCMPW,
X86_INS_VPCOMB,
X86_INS_VPCOMD,
X86_INS_VPCOMPRESSD,
X86_INS_VPCOMPRESSQ,
X86_INS_VPCOMQ,
X86_INS_VPCOMUB,
X86_INS_VPCOMUD,
X86_INS_VPCOMUQ,
X86_INS_VPCOMUW,
X86_INS_VPCOMW,
X86_INS_VPCONFLICTD,
X86_INS_VPCONFLICTQ,
X86_INS_VPERM2F128,
X86_INS_VPERM2I128,
X86_INS_VPERMD,
X86_INS_VPERMI2D,
X86_INS_VPERMI2PD,
X86_INS_VPERMI2PS,
X86_INS_VPERMI2Q,
X86_INS_VPERMIL2PD,
X86_INS_VPERMIL2PS,
X86_INS_VPERMILPD,
X86_INS_VPERMILPS,
X86_INS_VPERMPD,
X86_INS_VPERMPS,
X86_INS_VPERMQ,
X86_INS_VPERMT2D,
X86_INS_VPERMT2PD,
X86_INS_VPERMT2PS,
X86_INS_VPERMT2Q,
X86_INS_VPEXPANDD,
X86_INS_VPEXPANDQ,
X86_INS_VPEXTRB,
X86_INS_VPEXTRD,
X86_INS_VPEXTRQ,
X86_INS_VPEXTRW,
X86_INS_VPGATHERDD,
X86_INS_VPGATHERDQ,
X86_INS_VPGATHERQD,
X86_INS_VPGATHERQQ,
X86_INS_VPHADDBD,
X86_INS_VPHADDBQ,
X86_INS_VPHADDBW,
X86_INS_VPHADDDQ,
X86_INS_VPHADDD,
X86_INS_VPHADDSW,
X86_INS_VPHADDUBD,
X86_INS_VPHADDUBQ,
X86_INS_VPHADDUBW,
X86_INS_VPHADDUDQ,
X86_INS_VPHADDUWD,
X86_INS_VPHADDUWQ,
X86_INS_VPHADDWD,
X86_INS_VPHADDWQ,
X86_INS_VPHADDW,
X86_INS_VPHMINPOSUW,
X86_INS_VPHSUBBW,
X86_INS_VPHSUBDQ,
X86_INS_VPHSUBD,
X86_INS_VPHSUBSW,
X86_INS_VPHSUBWD,
X86_INS_VPHSUBW,
X86_INS_VPINSRB,
X86_INS_VPINSRD,
X86_INS_VPINSRQ,
X86_INS_VPINSRW,
X86_INS_VPLZCNTD,
X86_INS_VPLZCNTQ,
X86_INS_VPMACSDD,
X86_INS_VPMACSDQH,
X86_INS_VPMACSDQL,
X86_INS_VPMACSSDD,
X86_INS_VPMACSSDQH,
X86_INS_VPMACSSDQL,
X86_INS_VPMACSSWD,
X86_INS_VPMACSSWW,
X86_INS_VPMACSWD,
X86_INS_VPMACSWW,
X86_INS_VPMADCSSWD,
X86_INS_VPMADCSWD,
X86_INS_VPMADDUBSW,
X86_INS_VPMADDWD,
X86_INS_VPMASKMOVD,
X86_INS_VPMASKMOVQ,
X86_INS_VPMAXSB,
X86_INS_VPMAXSD,
X86_INS_VPMAXSQ,
X86_INS_VPMAXSW,
X86_INS_VPMAXUB,
X86_INS_VPMAXUD,
X86_INS_VPMAXUQ,
X86_INS_VPMAXUW,
X86_INS_VPMINSB,
X86_INS_VPMINSD,
X86_INS_VPMINSQ,
X86_INS_VPMINSW,
X86_INS_VPMINUB,
X86_INS_VPMINUD,
X86_INS_VPMINUQ,
X86_INS_VPMINUW,
X86_INS_VPMOVDB,
X86_INS_VPMOVDW,
X86_INS_VPMOVM2B,
X86_INS_VPMOVM2D,
X86_INS_VPMOVM2Q,
X86_INS_VPMOVM2W,
X86_INS_VPMOVMSKB,
X86_INS_VPMOVQB,
X86_INS_VPMOVQD,
X86_INS_VPMOVQW,
X86_INS_VPMOVSDB,
X86_INS_VPMOVSDW,
X86_INS_VPMOVSQB,
X86_INS_VPMOVSQD,
X86_INS_VPMOVSQW,
X86_INS_VPMOVSXBD,
X86_INS_VPMOVSXBQ,
X86_INS_VPMOVSXBW,
X86_INS_VPMOVSXDQ,
X86_INS_VPMOVSXWD,
X86_INS_VPMOVSXWQ,
X86_INS_VPMOVUSDB,
X86_INS_VPMOVUSDW,
X86_INS_VPMOVUSQB,
X86_INS_VPMOVUSQD,
X86_INS_VPMOVUSQW,
X86_INS_VPMOVZXBD,
X86_INS_VPMOVZXBQ,
X86_INS_VPMOVZXBW,
X86_INS_VPMOVZXDQ,
X86_INS_VPMOVZXWD,
X86_INS_VPMOVZXWQ,
X86_INS_VPMULDQ,
X86_INS_VPMULHRSW,
X86_INS_VPMULHUW,
X86_INS_VPMULHW,
X86_INS_VPMULLD,
X86_INS_VPMULLQ,
X86_INS_VPMULLW,
X86_INS_VPMULUDQ,
X86_INS_VPORD,
X86_INS_VPORQ,
X86_INS_VPOR,
X86_INS_VPPERM,
X86_INS_VPROTB,
X86_INS_VPROTD,
X86_INS_VPROTQ,
X86_INS_VPROTW,
X86_INS_VPSADBW,
X86_INS_VPSCATTERDD,
X86_INS_VPSCATTERDQ,
X86_INS_VPSCATTERQD,
X86_INS_VPSCATTERQQ,
X86_INS_VPSHAB,
X86_INS_VPSHAD,
X86_INS_VPSHAQ,
X86_INS_VPSHAW,
X86_INS_VPSHLB,
X86_INS_VPSHLD,
X86_INS_VPSHLQ,
X86_INS_VPSHLW,
X86_INS_VPSHUFB,
X86_INS_VPSHUFD,
X86_INS_VPSHUFHW,
X86_INS_VPSHUFLW,
X86_INS_VPSIGNB,
X86_INS_VPSIGND,
X86_INS_VPSIGNW,
X86_INS_VPSLLDQ,
X86_INS_VPSLLD,
X86_INS_VPSLLQ,
X86_INS_VPSLLVD,
X86_INS_VPSLLVQ,
X86_INS_VPSLLW,
X86_INS_VPSRAD,
X86_INS_VPSRAQ,
X86_INS_VPSRAVD,
X86_INS_VPSRAVQ,
X86_INS_VPSRAW,
X86_INS_VPSRLDQ,
X86_INS_VPSRLD,
X86_INS_VPSRLQ,
X86_INS_VPSRLVD,
X86_INS_VPSRLVQ,
X86_INS_VPSRLW,
X86_INS_VPSUBB,
X86_INS_VPSUBD,
X86_INS_VPSUBQ,
X86_INS_VPSUBSB,
X86_INS_VPSUBSW,
X86_INS_VPSUBUSB,
X86_INS_VPSUBUSW,
X86_INS_VPSUBW,
X86_INS_VPTESTMD,
X86_INS_VPTESTMQ,
X86_INS_VPTESTNMD,
X86_INS_VPTESTNMQ,
X86_INS_VPTEST,
X86_INS_VPUNPCKHBW,
X86_INS_VPUNPCKHDQ,
X86_INS_VPUNPCKHQDQ,
X86_INS_VPUNPCKHWD,
X86_INS_VPUNPCKLBW,
X86_INS_VPUNPCKLDQ,
X86_INS_VPUNPCKLQDQ,
X86_INS_VPUNPCKLWD,
X86_INS_VPXORD,
X86_INS_VPXORQ,
X86_INS_VPXOR,
X86_INS_VRCP14PD,
X86_INS_VRCP14PS,
X86_INS_VRCP14SD,
X86_INS_VRCP14SS,
X86_INS_VRCP28PD,
X86_INS_VRCP28PS,
X86_INS_VRCP28SD,
X86_INS_VRCP28SS,
X86_INS_VRCPPS,
X86_INS_VRCPSS,
X86_INS_VRNDSCALEPD,
X86_INS_VRNDSCALEPS,
X86_INS_VRNDSCALESD,
X86_INS_VRNDSCALESS,
X86_INS_VROUNDPD,
X86_INS_VROUNDPS,
X86_INS_VROUNDSD,
X86_INS_VROUNDSS,
X86_INS_VRSQRT14PD,
X86_INS_VRSQRT14PS,
X86_INS_VRSQRT14SD,
X86_INS_VRSQRT14SS,
X86_INS_VRSQRT28PD,
X86_INS_VRSQRT28PS,
X86_INS_VRSQRT28SD,
X86_INS_VRSQRT28SS,
X86_INS_VRSQRTPS,
X86_INS_VRSQRTSS,
X86_INS_VSCATTERDPD,
X86_INS_VSCATTERDPS,
X86_INS_VSCATTERPF0DPD,
X86_INS_VSCATTERPF0DPS,
X86_INS_VSCATTERPF0QPD,
X86_INS_VSCATTERPF0QPS,
X86_INS_VSCATTERPF1DPD,
X86_INS_VSCATTERPF1DPS,
X86_INS_VSCATTERPF1QPD,
X86_INS_VSCATTERPF1QPS,
X86_INS_VSCATTERQPD,
X86_INS_VSCATTERQPS,
X86_INS_VSHUFPD,
X86_INS_VSHUFPS,
X86_INS_VSQRTPD,
X86_INS_VSQRTPS,
X86_INS_VSQRTSD,
X86_INS_VSQRTSS,
X86_INS_VSTMXCSR,
X86_INS_VSUBPD,
X86_INS_VSUBPS,
X86_INS_VSUBSD,
X86_INS_VSUBSS,
X86_INS_VTESTPD,
X86_INS_VTESTPS,
X86_INS_VUNPCKHPD,
X86_INS_VUNPCKHPS,
X86_INS_VUNPCKLPD,
X86_INS_VUNPCKLPS,
X86_INS_VZEROALL,
X86_INS_VZEROUPPER,
X86_INS_WAIT,
X86_INS_WBINVD,
X86_INS_WRFSBASE,
X86_INS_WRGSBASE,
X86_INS_WRMSR,
X86_INS_XABORT,
X86_INS_XACQUIRE,
X86_INS_XBEGIN,
X86_INS_XCHG,
X86_INS_XCRYPTCBC,
X86_INS_XCRYPTCFB,
X86_INS_XCRYPTCTR,
X86_INS_XCRYPTECB,
X86_INS_XCRYPTOFB,
X86_INS_XEND,
X86_INS_XGETBV,
X86_INS_XLATB,
X86_INS_XRELEASE,
X86_INS_XRSTOR,
X86_INS_XRSTOR64,
X86_INS_XRSTORS,
X86_INS_XRSTORS64,
X86_INS_XSAVE,
X86_INS_XSAVE64,
X86_INS_XSAVEC,
X86_INS_XSAVEC64,
X86_INS_XSAVEOPT,
X86_INS_XSAVEOPT64,
X86_INS_XSAVES,
X86_INS_XSAVES64,
X86_INS_XSETBV,
X86_INS_XSHA1,
X86_INS_XSHA256,
X86_INS_XSTORE,
X86_INS_XTEST,
X86_INS_FDISI8087_NOP,
X86_INS_FENI8087_NOP,

X86_INS_ENDING          EQU ; mark the end of the list of insn

    
; Group of X86 instructions
X86_GRP_INVALID         EQU 0 ; = CS_GRP_INVALID
; Generic groups
; all jump instructions (conditional+direct+indirect jumps)
X86_GRP_JUMP            EQU 1 ; = CS_GRP_JUMP
; all call instructions
X86_GRP_CALL            EQU 2 ; = CS_GRP_CALL
; all return instructions
X86_GRP_RET             EQU 3 ; = CS_GRP_RET
; all interrupt instructions (int+syscall)
X86_GRP_INT             EQU 4 ;  = CS_GRP_INT
; all interrupt return instructions
X86_GRP_IRET            EQU 5 ; = CS_GRP_IRET
; all privileged instructions
X86_GRP_PRIVILEGE       EQU 6 ; = CS_GRP_PRIVILEGE

; Architecture-specific groups
X86_GRP_VM              EQU 128d ; all virtualization instructions (VT-x + AMD-V)
X86_GRP_3DNOW           EQU 129d
X86_GRP_AES             EQU 130d
X86_GRP_ADX             EQU 131d
X86_GRP_AVX             EQU 132d
X86_GRP_AVX2            EQU 133d
X86_GRP_AVX512          EQU 134d
X86_GRP_BMI             EQU 135d
X86_GRP_BMI2            EQU 136d
X86_GRP_CMOV            EQU 137d
X86_GRP_F16C            EQU 138d
X86_GRP_FMA             EQU 139d
X86_GRP_FMA4            EQU 140d
X86_GRP_FSGSBASE        EQU 141d
X86_GRP_HLE             EQU 142d
X86_GRP_MMX             EQU 143d
X86_GRP_MODE32          EQU 144d
X86_GRP_MODE64          EQU 145d
X86_GRP_RTM             EQU 146d
X86_GRP_SHA             EQU 147d
X86_GRP_SSE1            EQU 148d
X86_GRP_SSE2            EQU 149d
X86_GRP_SSE3            EQU 150d
X86_GRP_SSE41           EQU 151d
X86_GRP_SSE42           EQU 152d
X86_GRP_SSE4A           EQU 153d
X86_GRP_SSSE3           EQU 154d
X86_GRP_PCLMUL          EQU 155d
X86_GRP_XOP             EQU 156d
X86_GRP_CDI             EQU 157d
X86_GRP_ERI             EQU 158d
X86_GRP_TBM             EQU 159d
X86_GRP_16BITMODE       EQU 160d
X86_GRP_NOT64BITMODE    EQU 161d
X86_GRP_SGX             EQU 162d
X86_GRP_DQI             EQU 163d
X86_GRP_BWI             EQU 164d
X86_GRP_PFI             EQU 165d
X86_GRP_VLX             EQU 166d
X86_GRP_SMAP            EQU 167d
X86_GRP_NOVLX           EQU 168d
X86_GRP_ENDING          EQU 169d


; NOTE: All information in cs_detail is only available when CS_OPT_DETAIL = CS_OPT_ON
cs_detail               STRUCT 
    regs_read           BYTE 12 DUP (?) ; uint8_t - list of implicit registers read by this insn
    regs_read_count     BYTE ?          ; uint8_t - number of implicit registers read by this insn
    regs_write          BYTE 20 DUP (?) ; uint8_t - list of implicit registers modified by this insn
    regs_write_count    BYTE ?          ; uint8_t - number of implicit registers modified by this insn
    groups              BYTE 8 DUP (?)  ; uint8_t - list of group this instruction belong to
    groups_count        BYTE ?          ; uint8_t - number of groups this insn belongs to

    ; Architecture-specific instruction info
    union
    {
        cs_x86 x86; // X86 architecture, including 16-bit, 32-bit & 64-bit mode
        cs_arm64 arm64; // ARM64 architecture (aka AArch64)
        cs_arm arm;     // ARM architecture (including Thumb/Thumb2)
        cs_mips mips;   // MIPS architecture
        cs_ppc ppc; // PowerPC architecture
        cs_sparc sparc; // Sparc architecture
        cs_sysz sysz;   // SystemZ architecture
        cs_xcore xcore; // XCore architecture
    };
cs_detail               ENDS

; Detail information of disassembled instruction
cs_insn                 STRUCT
    id                  DWORD ?
    address             QWORD ?
    size_               WORD ?
    bytes               DB 16 DUP (?)
    mnemonic            DB CS_MNEMONIC_SIZE DUP (?)
    op_str              DB 160 DUP (?)
    detail              DWORD ? ; pointer to cs_detail <>
cs_insn                 ENDS


; All type of errors encountered by Capstone API.
; These are values returned by cs_errno()
CS_ERR_OK               EQU 0 ; No error: everything was fine
CS_ERR_MEM              EQU 1 ; Out-Of-Memory error: cs_open(), cs_disasm(), cs_disasm_iter()
CS_ERR_ARCH             EQU 2 ; Unsupported architecture: cs_open()
CS_ERR_HANDLE           EQU 3 ; Invalid handle: cs_op_count(), cs_op_index()
CS_ERR_CSH              EQU 4 ; Invalid csh argument: cs_close(), cs_errno(), cs_option()
CS_ERR_MODE             EQU 5 ; Invalid/unsupported mode: cs_open()
CS_ERR_OPTION           EQU 6 ; Invalid/unsupported option: cs_option()
CS_ERR_DETAIL           EQU 7 ; Information is unavailable because detail option is OFF
CS_ERR_MEMSETUP         EQU 8 ; Dynamic memory management uninitialized (see CS_OPT_MEM)
CS_ERR_VERSION          EQU 9 ; Unsupported version (bindings)
CS_ERR_DIET             EQU 10 ; Access irrelevant data in "diet" engine
CS_ERR_SKIPDATA         EQU 11 ; Access irrelevant data for "data" instruction in SKIPDATA mode
CS_ERR_X86_ATT          EQU 12 ; X86 AT&T syntax is unsupported (opt-out at compile time)
CS_ERR_X86_INTEL        EQU 13 ; X86 Intel syntax is unsupported (opt-out at compile time)
CS_ERR_X86_MASM         EQU 14 ; X86 Intel syntax is unsupported (opt-out at compile time)

; capstone exported functions
;
cs_version              PROTO C :DWORD, :DWORD ; (int* major, int* minor);
cs_support              PROTO C :DWORD ; (int query);
cs_open                 PROTO C :DWORD, :DWORD, :DWORD ; (cs_arch arch, cs_mode mode, csh* handle);
cs_close                PROTO C :DWORD ; (csh* handle);
cs_option               PROTO C :DWORD, :DWORD, :DWORD ; (csh handle, cs_opt_type type, size_t value);
cs_errno                PROTO C :DWORD ; (csh handle);
cs_strerror             PROTO C :DWORD ; (cs_err code);
cs_disasm               PROTO C :DWORD, :DWORD, :DWORD, QWORD, :DWORD, :DWORD ; (csh handle, const uint8_t* code, size_t code_size, uint64_t address, size_t count, cs_insn** insn);
cs_disasm_ex            PROTO C :DWORD, :DWORD, :DWORD, QWORD, :DWORD, :DWORD ; (csh handle, const uint8_t* code, size_t code_size, uint64_t address, size_t count, cs_insn** insn);
cs_free                 PROTO C :DWORD, :DWORD ; (cs_insn* insn, size_t count);
cs_malloc               PROTO C :DWORD ; (csh handle);
cs_disasm_iter          PROTO C :DWORD, :DWORD, :DWORD, QWORD, :DWORD ; (csh handle, const uint8_t** code, size_t* size, uint64_t* address, cs_insn* insn);
cs_reg_name             PROTO C :DWORD, :DWORD ; (csh handle, unsigned int reg_id);
cs_insn_name            PROTO C :DWORD, :DWORD ; (csh handle, unsigned int insn_id);
cs_group_name           PROTO C :DWORD, :DWORD ; (csh handle, unsigned int group_id);
cs_insn_group           PROTO C :DWORD, :DWORD, :DWORD ; (csh handle, const cs_insn* insn, unsigned int group_id);
cs_reg_read             PROTO C :DWORD, :DWORD, :DWORD ; (csh handle, const cs_insn* insn, unsigned int reg_id);
cs_reg_write            PROTO C :DWORD, :DWORD, :DWORD ; (csh handle, const cs_insn* insn, unsigned int reg_id);
cs_op_count             PROTO C :DWORD, :DWORD, :DWORD ; (csh handle, const cs_insn* insn, unsigned int op_type);
cs_op_index             PROTO C :DWORD, :DWORD, :DWORD, :DWORD ; (csh handle, const cs_insn* insn, unsigned int op_type, unsigned int position);
cs_regs_access          PROTO C :DWORD, :DWORD, :DWORD, :DWORD, :DWORD, :DWORD ; (csh handle, const cs_insn* insn, cs_regs regs_read, uint8_t* regs_read_count, cs_regs regs_write, uint8_t* regs_write_count);









